<template>
   <el-card class="box-card">
    <div slot="header" class="clearfix">
    <h1 class="container-title fl">添加运单</h1>
    </div>
    <!-- 在这里写数据 -->
    <el-card class="box-card-min">
    <div slot="header" class="clearfix">
        <!-- 客户名称 -->
  <el-form status-icon   label-width="80px" class="demo-ruleForm">
   <el-form-item label="发货单号">
    <el-input type="text" v-model="ordername" autocomplete="off" style="width:250px;"></el-input>
  </el-form-item>
  <el-form-item label="客户信息">
    <el-select  v-model="role_id" style="width:250px;">
     <el-option  v-for="role in role_list" :label="role.name" :key="role.id" :value="role.id"></el-option>
    </el-select>
  </el-form-item>
  
  

  <el-form-item>
    <el-button type="primary" @click="addorder" style="width:250px;">添加</el-button>
  </el-form-item>
</el-form>
</div>
</el-card>
</el-card>
       
    </template>
    
    <script>
      import {adduser,role,addcom,showcom,addway} from '../api/api'
    
        export default {
    
            data(){
                return {
                    msg:'你好，这里是首页',
                    ordername:'',
                    role_list:[],
                    role_id:''
                }
            },
            //定义组建标签
            components:{
            },
            filters: {
     
　　},
            //自定义方法
            methods:{
            addorder:function(){
            var params={'ordername':this.ordername,'c_id':this.role_id}
            addway(params).then( res => {
           if(res.code==200){
            this.$Message(res.message)
            
           }
         
        })
                },
                  show_user(){
                   showcom().then( res => {
                  this.role_list=res
         
              })
    
          },
    
            },
            //钩子方法
            mounted:function(){
               this.show_user()
    
            },
            //监听属性
            watch:{
    
    
            },
            //计算属性
            computed:{
             
    
    
            }
    
    
    
        }
    
    
    </script>
    
    <style>
 .box-card-min{
    height:200px;
    width:450px;
 
    margin:0 auto;
    margin-top:30px;
    
 }
  .box-card{
        
         height:650px;

    }
    
  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }
  .container-title {
    font-size: 20px;
    line-height: 32px;
    font-weight: normal;
    color: #39486c;
  }
  .fl {
    float: left;
  }
  .inp-box {
    font-size: 16px;
    line-height: 32px;
    margin-left: 30px;
}
 
 
  .login_title {
    margin: 0px auto 40px auto;
    text-align: center;
    color: #505458;
  }
    </style>